package client.texture;

public class UV {

    public final int width, height;
    public final int x0, y0, x1, y1;
    public final float u0, v0, u1, v1;

    public UV(int width, int height, int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1) {
        this.width = width;
        this.height = height;
        this.x0 = x0;
        this.y0 = y0;
        this.x1 = x1;
        this.y1 = y1;
        this.u0 = u0;
        this.v0 = v0;
        this.u1 = u1;
        this.v1 = v1;
    }

    public UV(int width, int height, int x0, int y0, int textureWidth, int textureHeight) {
        this.width = width;
        this.height = height;
        this.x0 = x0;
        this.y0 = y0;
        this.x1 = x0 + width;
        this.y1 = y0 + height;
        this.u0 = (float) x0 / textureWidth;
        this.u1 = (float) x1 / textureWidth;
        this.v0 = (float) y0 / textureHeight;
        this.v1 = (float) y1 / textureHeight;
    }
}
